#include <hxcpp.h>

#ifndef INCLUDED_Std
#include <Std.h>
#endif
#ifndef INCLUDED_cpp_CppInt32__
#include <cpp/CppInt32__.h>
#endif
#ifndef INCLUDED_haxe_Log
#include <haxe/Log.h>
#endif
#ifndef INCLUDED_jax_io_JCloseable
#include <jax/io/JCloseable.h>
#endif
#ifndef INCLUDED_jax_io_JFilterOutputStream
#include <jax/io/JFilterOutputStream.h>
#endif
#ifndef INCLUDED_jax_io_JOutputStream
#include <jax/io/JOutputStream.h>
#endif
#ifndef INCLUDED_jax_io_JPrintStream
#include <jax/io/JPrintStream.h>
#endif
#ifndef INCLUDED_jax_lang_JAutoClosable
#include <jax/lang/JAutoClosable.h>
#endif
namespace jax{
namespace io{

Void JPrintStream_obj::__construct(Dynamic f,Dynamic s)
{
{
	HX_SOURCE_POS("Source/jax/io/JPrintStream.hx",9)
	if (((bool((s == null())) && bool(::Std_obj::is(f,hx::ClassOf< ::jax::io::JOutputStream >()))))){
		HX_SOURCE_POS("Source/jax/io/JPrintStream.hx",11)
		super::__construct(f);
	}
	else{
		HX_SOURCE_POS("Source/jax/io/JPrintStream.hx",13)
		super::__construct(null());
	}
}
;
	return null();
}

JPrintStream_obj::~JPrintStream_obj() { }

Dynamic JPrintStream_obj::__CreateEmpty() { return  new JPrintStream_obj; }
hx::ObjectPtr< JPrintStream_obj > JPrintStream_obj::__new(Dynamic f,Dynamic s)
{  hx::ObjectPtr< JPrintStream_obj > result = new JPrintStream_obj();
	result->__construct(f,s);
	return result;}

Dynamic JPrintStream_obj::__Create(hx::DynamicArray inArgs)
{  hx::ObjectPtr< JPrintStream_obj > result = new JPrintStream_obj();
	result->__construct(inArgs[0],inArgs[1]);
	return result;}

Void JPrintStream_obj::println( Dynamic d){
{
		HX_SOURCE_PUSH("JPrintStream_obj::println")
		HX_SOURCE_POS("Source/jax/io/JPrintStream.hx",16)
		::String ts = ::Std_obj::string(d);
		HX_SOURCE_POS("Source/jax/io/JPrintStream.hx",17)
		{
			HX_SOURCE_POS("Source/jax/io/JPrintStream.hx",17)
			int _g1 = (int)0;
			int _g = ts.length;
			HX_SOURCE_POS("Source/jax/io/JPrintStream.hx",17)
			while(((_g1 < _g))){
				HX_SOURCE_POS("Source/jax/io/JPrintStream.hx",17)
				int i = (_g1)++;
				HX_SOURCE_POS("Source/jax/io/JPrintStream.hx",18)
				this->write(ts.charCodeAt(i),null(),null());
			}
		}
		HX_SOURCE_POS("Source/jax/io/JPrintStream.hx",20)
		this->write(::jax::io::JPrintStream_obj::NEW_LINE,null(),null());
		HX_SOURCE_POS("Source/jax/io/JPrintStream.hx",22)
		::haxe::Log_obj::trace((ts + HX_CSTRING(" wrote to print stream")),hx::SourceInfo(HX_CSTRING("JPrintStream.hx"),22,HX_CSTRING("jax.io.JPrintStream"),HX_CSTRING("println")));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(JPrintStream_obj,println,(void))

Dynamic JPrintStream_obj::NEW_LINE;


JPrintStream_obj::JPrintStream_obj()
{
}

void JPrintStream_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(JPrintStream);
	super::__Mark(HX_MARK_ARG);
	HX_MARK_END_CLASS();
}

void JPrintStream_obj::__Visit(HX_VISIT_PARAMS)
{
	super::__Visit(HX_VISIT_ARG);
}

Dynamic JPrintStream_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 7:
		if (HX_FIELD_EQ(inName,"println") ) { return println_dyn(); }
		break;
	case 8:
		if (HX_FIELD_EQ(inName,"NEW_LINE") ) { return NEW_LINE; }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic JPrintStream_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	switch(inName.length) {
	case 8:
		if (HX_FIELD_EQ(inName,"NEW_LINE") ) { NEW_LINE=inValue.Cast< Dynamic >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void JPrintStream_obj::__GetFields(Array< ::String> &outFields)
{
	super::__GetFields(outFields);
};

static ::String sStaticFields[] = {
	HX_CSTRING("NEW_LINE"),
	String(null()) };

static ::String sMemberFields[] = {
	HX_CSTRING("println"),
	String(null()) };

static void sMarkStatics(HX_MARK_PARAMS) {
	HX_MARK_MEMBER_NAME(JPrintStream_obj::NEW_LINE,"NEW_LINE");
};

static void sVisitStatics(HX_VISIT_PARAMS) {
	HX_VISIT_MEMBER_NAME(JPrintStream_obj::__mClass,"__mClass");
	HX_VISIT_MEMBER_NAME(JPrintStream_obj::NEW_LINE,"NEW_LINE");
};

Class JPrintStream_obj::__mClass;

void JPrintStream_obj::__register()
{
	Static(__mClass) = hx::RegisterClass(HX_CSTRING("jax.io.JPrintStream"), hx::TCanCast< JPrintStream_obj> ,sStaticFields,sMemberFields,
	&__CreateEmpty, &__Create,
	&super::__SGetClass(), 0, sMarkStatics, sVisitStatics);
}

void JPrintStream_obj::__boot()
{
	hx::Static(NEW_LINE) = HX_CSTRING("\n").charCodeAt((int)0);
}

} // end namespace jax
} // end namespace io
